<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>原型对象</title>
</head>
<body>
    <h1>原型对象</h1>

    <script>
        

        function Dog(name,age) {
            this.name = name ;
            this.age = age ;

            this.eat = function() {
                console.log("吃...");
            }
        }

        var xb = new Dog('小白',8) ;
        var xh = new Dog('小花',6) ;

        console.log(xb);
        console.log(xh);
        



    </script>
</body>
</html>